﻿using Basic.FormGatewaryModular.Interface;
using Basic.FormRemoteModel.PageCalculate;
using Basic.FormRemoteModel.PageCalculate.Model;
using WeDonekRpc.HttpApiGateway.Model;
using WeDonekRpc.Model;

namespace Basic.FormGatewaryModular.Services
{
    internal class CalculateService : ICalculateService
    {
        public CensusTableResult CensusTable ( CalculateArg param )
        {
            return new CalculateCensusTable
            {
                Param = param
            }.Send();
        }
        public DataTableResult DataTable ( PagingParam<CalculateArg> param )
        {
            return new CalculateDataTable
            {
                Param = param.Query,
                Paging = new BasicPage
                {
                    IsDesc = param.IsDesc,
                    Size = param.Size,
                    SortName = param.SortName,
                    Index = param.Index,
                    NextId = param.NextId
                }
            }.Send();
        }
        public decimal? Statistics ( CalculateArg param )
        {
            return new CalculateStatistics
            {
                Param = param
            }.Send();
        }
        public ChartResult Chart ( CalculateArg param )
        {
            return new CalculateChart
            {
                Param = param
            }.Send();
        }
    }
}
